package com.java.wechat.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.java.wechat.entity.FriendsRequest;
import com.java.wechat.entity.vo.FriendRequestVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author jiangli
 * @email 31346337@qq.com
 * @date 2019-11-01 19:47:34
 */
@Mapper
public interface FriendsRequestDao extends BaseMapper<FriendsRequest> {

	@Select("SELECT u.`id` sendUserId,u.`username` sendUsername,u.`face_image` sendFaceImage,u.`nickname` sendNickname FROM `friends_request` f LEFT JOIN `user` u ON f.`send_user_id` = u.`id` WHERE f.`accept_user_id` = #{acceptUserId}")
	List<FriendRequestVO> queryFriendRequests(String acceptUserId);
	
}
